package pub.cleangao.mybatis.expression;

/**
 * 操作符
 */
public enum WhereOperator {
    /**
     * 等于=
     */
    eq("="),
    /**
     * 大于&gt;
     */
    gt(">"),
    /**
     * 小于&lt;
     */
    lt("<"),
    /**
     * 大于等于&gt;=
     */
    ge(">="),
    /**
     * 小于等于&lt;=
     */
    le("<="),
    /**
     * 不等于&lt;&gt;
     */
    notEq("<>"),
    /**
     * in()查询
     */
    in("IN"),
    /**
     * not in()查询
     */
    notIn("NOT IN"),
    /**
     * between查询
     */
    between("BETWEEN"),
    /**
     * 模糊查询,两边模糊查询,like '%xx%'
     */
    like("LIKE"),

    // -- sql
    nil(" IS NULL"),

    notNil(" IS NOT NULL");


    private final String operator;

    WhereOperator(String operator) {
        this.operator = operator;
    }

    /**
     * 返回操作符,{@literal =,>=,<... }
     *
     * @return 返回操作符
     */
    public String getOperator() {
        return operator;
    }

}
